<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <title>商品后台管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/course_category.css">
</head>

<body>
    <nav class="navbar">
        <div class="container" style="height: 80px;background: #58a3f9">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <a class="navbar-brand" href="#">
                    <img src="image/easy-pay.png">
                </a>
            </div>
            <ul class="nav navbar-nav navbar-right" style="margin-top: 30px">
                <li><a href="#"><span class="inner">首页</span></a></li>
                <li>
                    <a href="#">
                        <span class="inner">商品管理</span></a>
                </li>
                <li>
                    <a href="#">
                        <span class="inner">购物车管理</span>
                    </a>
                </li>

                <li>
                    <a href="#">
                        <span class="inner">用户管理</span></a>
                </li>
            </ul>

        </div><!-- /.container-fluid -->
    </nav>
    <div style="min-height: 400px">
        <div class="container">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4>商品管理-商品详情</h4>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered" id="introduce">
                        <!-- 在此处添加并完善文档结构代码，参考以下注释文档 -->
                        <!-- <tr>
                            <td style="width: 25%" class="text-center">商品编号</td>
                            <td class="text-left" id="id"></td>
                        </tr> -->
                        <tr>
                            <td style="width: 25%" class="text-center">商品编号</td>
                            <td class="text-left" id="inputId"></td>
                          </tr>
                          <tr>
                            <td  class="text-center">商品标题</td>
                            <td class="text-left" id="inputTitle"></td>
                          </tr>
                          <tr>
                            <td class="text-center">商品描述</td>
                            <td class="text-left" id="inputContent"></td>
                          </tr>
                          <tr>
                            <td class="text-center">图片路径</td>
                            <td class="text-left" id="inputImagePath"></td>
                          </tr>
                          <tr>
                            <td  class="text-center">商品价格</td>
                            <td class="text-left" id="inputPrice"></td>
                          </tr>
                    </table>
                    <div style="text-align: center">
                        <button class="btn btn-primary">返回上一级</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 请在此处添加页脚 -->
    <footer>
        <div class="footer">
        <p class="text-center">易购集团</p>
        <p class="text-center">Copyright 2020</p>
        </div>
    </footer>

</body>
</html>
<script src="./js/axios.min.js"></script>
 <script>
      var intr = document.getElementById('introduce');
      axios.post('http://127.0.0.1:8081/h6/goods/getGoods',{id:1})
      .then(res =>{
          if(res.status ===200){
              console.log(res.data)
              if(res.data.success){
                  var div =
                  `<table class ="table table-bordered">
                  <tbody>
                  <tr>
                     <td style="width: 25%" class="text-center">商品编号</td>
                     <td class="text-left" id="inputId">${res.data.data.id}</td>
                   </tr>
                   <tr>
                     <td  class="text-center">商品标题</td>
                     <td class="text-left" id="inputTitle">${res.data.data.title}</td>
                   </tr>
                   <tr>
                     <td class="text-center">商品描述</td>
                     <td class="text-left" id="inputContent">${res.data.data.content}</td>
                   </tr>
                   <tr>
                     <td class="text-center">图片路径</td>
                     <td class="text-left" id="inputImagePath">${res.data.data.imagePath}</td>
                   </tr>
                   <tr>
                     <td  class="text-center">商品价格</td>
                     <td class="text-left" id="inputPrice">${res.data.data.price}</td>
                   </tr>
                     </tbody>
                     </table>
                     <div style="text-align: center">
                      
                        </div>`
                        intr.innerHTML = div
              }
          }
      })
 </script>